<template>
    <div>
        <!-- 营销调度 -->
        <!-- 左侧导航栏 -->
        <el-row>
            <el-col :span="4" class="left-nav">
                <el-menu
                    :default-active="dfActive"
                    class="el-menu-vertical-demo">
                    <el-submenu index="1">
                        <template slot="title">
                        <img src="../../assets/imgs/menu_icon_jigou_default.png" alt="">&nbsp;
                        <span>机构单位</span>
                        </template>
                        <el-menu-item-group>
                        <el-menu-item index="1-1" @click="jumpTo(1)">机构管理</el-menu-item>
                        <el-menu-item index="1-2" @click="jumpTo(2)">代售管理</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                        <img src="../../assets/imgs/menu_icon_juse_default.png" alt="">&nbsp;
                        <span>角色用户</span>
                        </template>
                        <el-menu-item-group>
                        <el-menu-item index="2-1" @click="jumpTo(3)">用户管理</el-menu-item>
                        <el-menu-item index="2-2" @click="jumpTo(4)">用户组管理</el-menu-item>
                        <el-menu-item index="2-3" @click="jumpTo(5)">角色管理</el-menu-item>
                        <el-menu-item index="2-4" @click="jumpTo(6)">资源管理</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="3">
                        <template slot="title">
                        <img src="../../assets/imgs/menu_icon_xitong_default.png" alt="">&nbsp;
                        <span>系统运维</span>
                        </template>
                        <el-menu-item-group>
                        <el-menu-item index="3-1" @click="jumpTo(7)">系统设置</el-menu-item>
                        <el-menu-item index="3-2" @click="jumpTo(8)">打印设置</el-menu-item>
                        <el-menu-item index="3-3" @click="jumpTo(9)">自定义日期段</el-menu-item>
                        <el-menu-item index="3-4" @click="jumpTo(10)">系统作业</el-menu-item>
                        <el-menu-item index="3-5" @click="jumpTo(11)">数据同步</el-menu-item>
                        <el-menu-item index="3-6" @click="jumpTo(12)">操作日志</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-col>
            <!-- 路由 -->
            <el-col :span="20" class="router-container">
                <router-view @sendActive="getActive"></router-view>
            </el-col>
        </el-row>
    </div>
</template>

<script>
export default {
    data: function(){
        return {
            dfActive:"1-1"
        }
    },
    methods:{
        jumpTo(i){
            switch(i){
                case 1:this.$router.push("/index/allManage/orgManage");break;
                case 2:this.$router.push("/index/allManage/salesManage");break;
                case 3:this.$router.push("/index/allManage/userManage");break;
                case 4:this.$router.push("/index/allManage/userGroupManage");break;
                case 5:this.$router.push("/index/allManage/charaterManage");break;
                case 6:this.$router.push("/index/allManage/resourManage");break;
                case 7:this.$router.push("/index/allManage/osManage");break;
                case 8:this.$router.push("/index/allManage/printManage");break;
                case 9:this.$router.push("/index/allManage/cusDate");break;
                case 10:this.$router.push("/index/allManage/osWork");break;
                case 11:this.$router.push("/index/allManage/dataSync");break;
                case 12:this.$router.push("/index/allManage/operLog");break;
            }
        },
        getActive(val){
            this.dfActive=val;
            console.log(this.dfActive)
        }
    },
    computed:{},
    watch:{},
    mounted() {
        this.$emit("sendTag",12);
    }
}   
</script>
<style scoped>
.left-nav{
    border:1px solid #EDEEF0;
}
</style>